import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询
export function listCourser(query) {
  return request({
    url: '/system/course/list',
    method: 'get',
    params: query
  })
}

//查询详情
export function getCourse(courseId) {
  return request({
    url: '/system/course/' + parseStrEmpty(courseId),
    method: 'get'
  })
}

// 更新
export function updateCourse(data) {
  return request({
    url: '/system/course/edit',
    method: 'put',
    data: data
  })
}

export function addCourse(data) {
  return request({
    url: '/system/course/insert',
    method: 'post',
    data: data
  })
}

export function deleteCourse(courseId) {
  return request({
    url: '/system/course/delete/' + + parseStrEmpty(courseId),
    method: 'post',
  })
}

export function activatedCourse(courseId) {
  return request({
    url: '/system/course/activated/' + + parseStrEmpty(courseId),
    method: 'post',
  })
}
